import * as types from './mutation-types.js'
import router from '../router/index.js'

export default {
  [types.CHANGE_PAGE](state, { titleIndex }) {
    state.pageIndex = titleIndex;
    // router.push({
    //   path: '/' + state.pageArray[state.pageIndex].routename
    // })
  },

  [types.GO_DETAIL_PAGES](state, { id }) {
    router.push({ name: 'detail', params: { newsId: id } })
  },

  [types.TABBAR_SHOW](state, { tabbarshowIndex }) {
    state.tabbarshowIndex = tabbarshowIndex;
  },

  [types.BACKICON_SHOW](state, { backIconshowIndex }) {
    state.backIconshowIndex = backIconshowIndex;
  },

}